import request from '@/utils/defaultRequest'

// 获取订单
export function getCartList(pageNo, pageSize) {
  if (pageNo) {
    return request({
      url: `/product/getCartList?pageNo=${pageNo}&pageSize=${pageSize}`,
      method: 'get'
    })
  } else {
    return request({
      url: '/product/getCartList',
      method: 'get'
    })
  }
}

// 修改订单
export function editCartList(data) {
  return request({
    url: `/product/editCartList/${data.id}`,
    method: 'post',
    data: data.data
  })
}

// 删除订单
export function delCartList(id) {
  return request({
    url: `/product/delCartListr/${id}`,
    method: 'post'
  })
}

// 根据手机号查询订单getOneCart/:phone
export function getOneCart(phone) {
  return request({
    url: `/product/getOneCart/${phone}`,
    method: 'post'
  })
}
